<!DOCTYPE html>
<html lang="en">

<head>
    <base href="/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Toyqo - Kids Store Bootstrap 5 Template</title>

    <!-- Favicons -->
    <link rel="stylesheet" href="layui/css/layui.css">

    <!-- Vendor CSS (Icon Font) -->

    <link rel="stylesheet" href="front/css/fontawesome.min.css">
    <link rel="stylesheet" href="front/css/pe-icon-7-stroke.min.css">


    <!-- Plugins CSS (All Plugins Files) -->


    <link rel="stylesheet" href="front/css/swiper-bundle.min.css">
    <link rel="stylesheet" href="front/css/animate.min.css">
    <link rel="stylesheet" href="front/css/lightgallery.min.css">
    <link rel="stylesheet" href="front/css/aos.min.css">
    <link rel="stylesheet" href="front/css/nice-select.min.css">


    <!-- Main Style CSS -->
    <link rel="stylesheet" href="front/css/style.css">


    <!-- Use the minified version files listed below for better performance and remove the files listed above -->

    <!--
<link rel="stylesheet" href="assets/css/vendor/vendor.min.css">
<link rel="stylesheet" href="assets/css/plugins/plugins.min.css">
<link rel="stylesheet" href="assets/css/style.min.css"> 
-->
</head>

<body>


<div class="header section">

    <!-- Header Top Start -->
    <div class="header-top bg-primary">
        <div class="container">
            <div class="row align-items-center">

                <!-- Header Top Message Start -->
                <div class="col-12">
                    <div class="header-top-msg-wrapper text-center">
                        <p class="header-top-message text-center">最高50%折扣 <strong>冬季</strong> 系列 <a href="page/shoppage" class="btn btn-hover-dark btn-secondary">立即购买</a></p>
                        <div class="header-top-close-btn">
                            <button class="top-close-btn"><i class="pe-7s-close"></i></button>
                        </div>
                    </div>
                </div>
                <!-- Header Top Message End -->
            </div>
        </div>
    </div>
    <!-- Header Top End -->

    <!-- Header Bottom Start -->
    <div class="header-bottom">
        <div class="header-sticky">
            <div class="container">
                <div class="row align-items-center position-relative">

                    <!-- Header Logo Start -->
                    <div class="col-md-6 col-lg-3 col-xl-2 col-6">
                        <div class="header-logo">
                            <a href="page/shoppage"><img src="front/picture/logo.png" alt="Site Logo"></a>
                        </div>
                    </div>
                    <!-- Header Logo End -->

                    <!-- Header Menu Start -->
                    <div class="col-lg-6 d-none d-lg-block">

                        <div class="main-menu">
                            <ul>
                                <li class="has-children">
                                    <a href="page/index">首页</a>
                                </li>
                                <li class="has-children position-static">
                                    <a href="page/shoppage">购物</a>
                                </li>
                                <li><a href="page/about">关于我们</a></li>
                                <li><a href="page/contact">联系我们</a></li>
                            </ul>
                        </div>

                    </div>
                    <!-- Header Menu End -->

                    <!-- Header Action Start -->
                    <div class="col-md-6 col-lg-3 col-xl-4 col-6 justify-content-end">
                        <div class="header-actions">
                            <div class="dropdown-user d-none d-lg-block">
                                <a href="page/account" class="header-action-btn"><i class="pe-7s-user"></i></a>
                            </div>
                            <a href="page/wishlist" class="header-action-btn header-action-btn-wishlist">
                                <i class="pe-7s-like"></i>
                            </a>
                            <a href="page/cart" class="header-action-btn header-action-btn-cart">
                                <i class="pe-7s-cart"></i>
                            </a>
                            <!-- Mobile Menu Hambarger Action Button Start -->
                            <a href="javascript:void(0)" class="header-action-btn header-action-btn-menu d-lg-none d-md-block">
                                <i class="fa fa-bars"></i>
                            </a>
                            <!-- Mobile Menu Hambarger Action Button End -->

                        </div>
                    </div>
                    <!-- Header Action End -->

                </div>
            </div>
        </div>
    </div>
    <!-- Header Bottom End -->

    <!-- Offcanvas Search Start -->
    <div class="offcanvas-search">
        <div class="offcanvas-search-inner">

            <!-- Button Close Start -->
            <div class="offcanvas-btn-close">
                <i class="pe-7s-close"></i>
            </div>
            <!-- Button Close End -->

            <!-- Offcanvas Search Form Start -->
            <form class="offcanvas-search-form" action="#">
                <input type="text" placeholder="Search Product..." class="offcanvas-search-input">
            </form>
            <!-- Offcanvas Search Form End -->

        </div>
    </div>
    <!-- Offcanvas Search End -->

</div>
<!-- Header Section End -->


    <!-- Breadcrumb Section Start -->
    <div class="section">

        <!-- Breadcrumb Area Start -->
        <div class="breadcrumb-area bg-primary">
            <div class="container">
                <div class="breadcrumb-content">
                    <ul>
                        <li>
                            <a href="index.html"><i class="fa fa-home"></i> </a>
                        </li>
                        <li class="active"> 订单页</li>
                    </ul>
                </div>
            </div>
        </div>
        <!-- Breadcrumb Area End -->

    </div>
    <!-- Breadcrumb Section End -->

    <!-- Checkout Section Start -->
    <div class="section section-margin">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <!-- Coupon Accordion Start -->
                    <div class="coupon-accordion">



                    </div>
                    <!-- Coupon Accordion End -->
                </div>
            </div>
            <div class="row mb-n4">
                <div class="col-lg-6 col-12 mb-4">

                    <!-- Checkbox Form Start -->
                    <form action="#">
                        <div class="checkbox-form">

                            <!-- Checkbox Form Title Start -->
                            <h3 class="title">账单明细</h3>
                            <!-- Checkbox Form Title End -->

                            <div class="row">

                                <div class="col-md-6">
                                    <div class="checkout-form-list">
                                        <label>收货人 <span class="required">*</span></label>
                                        <input name="receivernameA" type="text" readonly>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="checkout-form-list">
                                        <label>电话号码 <span class="required">*</span></label>
                                        <input name="receiverphoneA" type="text" readonly>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="checkout-form-list">
                                        <label>省 <span class="required">*</span></label>
                                        <input name="receiverprovinceA" type="text" readonly>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="checkout-form-list">
                                        <label>市 <span class="required">*</span></label>
                                        <input name="receivercityA" type="text" readonly>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="checkout-form-list">
                                        <label>区 <span class="required">*</span></label>
                                        <input name="receiverdistrictA" type="text" readonly>
                                    </div>
                                </div>

                                <div class="col-md-12">
                                    <div class="checkout-form-list">
                                        <label>详细地址 <span class="required">*</span></label>
                                        <input name="receiveraddressA" type="text" readonly>
                                    </div>
                                </div>
                                <!-- Town or City Name Input End -->
                            </div>

                            <!-- Different Address Start -->
                            <div class="different-address">
                                <!-- Ship Different Title Checkbox Start -->
                                <div class="ship-different-title">
                                    <div>
                                        <input id="ship-box" type="checkbox">
                                        <label for="ship-box" class="checkbox-label">不使用默认地址，使用新的地址?</label>
                                    </div>
                                </div>
                                <!-- Ship Different Title Checkbox End -->

                                <!-- Ship Box Info Start -->
                                <div id="ship-box-info" class="row mt-2">

                                    <!-- Select Country Name Start -->
                                    <div> <!--class="col-md-12"-->
                                        <div class="myniceselect country-select clearfix">
                                            <label>保存的地址 <span class="required">*</span></label>
                                                <div class="layui-tab layui-tab-card">
                                                    <ul class="layui-tab-title" id="tab-title">
                                                        <!-- 选项卡标题将动态生成 -->
                                                    </ul>
                                                    <div class="layui-tab-content" style="height: 200px;" id="tab-content">
                                                        <!-- 选项卡内容将动态生成 -->
                                                    </div>
                                                </div>
                                            <button id="addaddress" type="button" class="layui-btn layui-btn-sm"  style="background-color: #00c4cc">新增</button>
                                        </div>
                                    </div>
                                    <!-- Select Country Name End -->



                                </div>
                                <!-- Ship Box Info End -->

                                <!-- Order Notes Textarea Start -->

                                <!-- Order Notes Textarea End -->

                            </div>
                            <!-- Different Address End -->
                        </div>
                    </form>
                    <!-- Checkbox Form End -->

                </div>

                <div class="col-lg-6 col-12 mb-4">

                    <!-- Your Order Area Start -->
                    <div class="your-order-area border">

                        <!-- Title Start -->
                        <h3 class="title">你的订单</h3>
                        <!-- Title End -->

                        <!-- Your Order Table Start -->
                        <div class="your-order-table table-responsive">
                            <table class="table">

                                <!-- Table Head Start -->
                                <thead>
                                    <tr class="cart-product-head">
                                        <th class="cart-product-name text-start">商品</th>
                                        <th class="cart-product-total text-end">总价</th>
                                    </tr>
                                </thead>
                                <!-- Table Head End -->

                                <!-- Table Body Start -->
                                <tbody id="orderlist">

                                </tbody>
                                <!-- Table Body End -->

                                <!-- Table Footer Start -->
                                <tfoot>
                                    <tr class="cart-subtotal">
                                        <th class="text-start ps-0">购物车合计</th>
                                        <td class="text-end pe-0"><span class="amount totalprice">$0.00</span></td>
                                    </tr>
                                    <tr class="order-total">
                                        <th class="text-start ps-0">订单总价</th>
                                        <td class="text-end pe-0"><strong><span class="amount totalprice">$0.00</span></strong></td>
                                    </tr>
                                </tfoot>
                                <!-- Table Footer End -->

                            </table>
                        </div>
                        <!-- Your Order Table End -->

                        <!-- Payment Accordion Order Button Start -->
                        <div class="payment-accordion-order-button">
                            <div class="payment-accordion">
                                <div class="single-payment">
                                    <h5 class="panel-title mb-3">
                                        <a class="collapse-off" data-bs-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
                                            直接银行转账
                                        </a>
                                    </h5>
                                    <div class="collapse show" id="collapseExample">
                                        <div class="card card-body rounded-0">
                                            <p>请直接将您的款项存入我们的银行账户。请使用您的订单ID作为付款参考。在我们的账户资金结清之前，您的订单不会发货。</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="single-payment">
                                    <h5 class="panel-title mb-3">
                                        <a class="collapse-off" data-bs-toggle="collapse" href="#collapseExample-2" aria-expanded="false" aria-controls="collapseExample-2">
                                            支票付款
                                        </a>
                                    </h5>
                                    <div class="collapse" id="collapseExample-2">
                                        <div class="card card-body rounded-0">
                                            <p>请直接将您的款项存入我们的银行账户。请使用您的订单ID作为付款参考。在我们的账户资金结清之前，您的订单不会发货。</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="single-payment">
                                    <h5 class="panel-title mb-3">
                                        <a class="collapse-off" data-bs-toggle="collapse" href="#collapseExample-3" aria-expanded="false" aria-controls="collapseExample-3">
                                            Paypal
                                        </a>
                                    </h5>
                                    <div class="collapse" id="collapseExample-3">
                                        <div class="card card-body rounded-0">
                                            <p>请直接将您的款项存入我们的银行账户。请使用您的订单ID作为付款参考。在我们的账户资金结清之前，您的订单不会发货。</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="order-button-payment">
                                <button id="placeorder" class="btn btn-primary btn-hover-secondary rounded-0 w-100">下订单</button>
                            </div>
                        </div>
                        <!-- Payment Accordion Order Button End -->
                    </div>
                    <!-- Your Order Area End -->
                </div>
            </div>
        </div>
    </div>
    <!-- Checkout Section End -->

    <!-- Footer Section Start -->
    <footer class="section footer-section">
        <!-- Footer Top Start -->
        <div class="footer-top bg-primary section-padding">
            <div class="container">
                <div class="row mb-n8">
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h1 class="widget-title">About Us</h1>
                            <p class="desc-content">We are a team of designers and developers that create high quality wordpress, shopify, Opencart</p>
                            <!-- Soclial Link Start -->
                            <div class="widget-social justify-content-start mb-n2">
                                <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                                <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                                <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                                <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                                <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                            </div>
                            <!-- Social Link End -->
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h2 class="widget-title">Contact Us</h2>
                            <ul class="contact-links">
                                <li><i class="pe-7s-home"></i> <span>Your address goes here</span> </li>
                                <li><i class="pe-7s-mail"></i><a href="mailto:info@example.com"> info@example.com</a></li>
                                <li><i class="pe-7s-call"></i><a href="tel:+012-3456-789"> +012 3456 789</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget aos-init aos-animate">
                            <h2 class="widget-title">Information</h2>
                            <ul class="widget-list">
                                <li><a href="contact.html">Terms & Conditions</a></li>
                                <li><a href="contact.html">Payment Methode</a></li>
                                <li><a href="contact.html">Product Warranty</a></li>
                                <li><a href="contact.html">Return Process</a></li>
                                <li><a href="contact.html">Payment Security</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-12 col-sm-6 col-lg-3 mb-8">
                        <div class="single-footer-widget">
                            <h2 class="widget-title">Signup for newsletter</h2>
                            <div class="widget-body">
                                <!-- Newsletter Form Start -->
                                <div class="newsletter-form-wrap pt-1">
                                    <form id="mc-form" class="mc-form">
                                        <input type="email" id="mc-email" class="form-control email-box mb-4" placeholder="demo@example.com" name="EMAIL">
                                        <button id="mc-submit" class="newsletter-btn" type="submit">Subscribe</button>
                                    </form>
                                    <!-- mailchimp-alerts Start -->
                                    <div class="mailchimp-alerts text-centre">
                                        <div class="mailchimp-submitting"></div><!-- mailchimp-submitting end -->
                                        <div class="mailchimp-success text-success"></div><!-- mailchimp-success end -->
                                        <div class="mailchimp-error text-danger"></div><!-- mailchimp-error end -->
                                    </div>
                                    <!-- mailchimp-alerts end -->
                                </div>
                                <!-- Newsletter Form End -->
                                <p class="desc-content mb-0">Join over 1,000 people who get free and fresh content delivered automatically each time we publish</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Top End -->

        <!-- Footer Bottom Start -->
        <div class="footer-bottom bg-secondary pt-4 pb-4">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-12 text-center">
                        <div class="copyright-content">
                            <p class="mb-0">Copyright &copy; 2023.Company name All rights reserved.<a target="_blank" href="https://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Bottom End -->
    </footer>
    <!-- Footer Section End -->


    <a href="#" class="scroll-top show" id="scroll-top">
        <i class="arrow-top pe-7s-angle-up-circle"></i>
        <i class="arrow-bottom pe-7s-angle-up-circle"></i>
    </a>

    <!-- Mobile Menu Start -->
    <div class="mobile-menu-wrapper">
        <div class="offcanvas-overlay"></div>

        <!-- Mobile Menu Inner Start -->
        <div class="mobile-menu-inner">

            <!-- Button Close Start -->
            <div class="offcanvas-btn-close">
                <i class="pe-7s-close"></i>
            </div>
            <!-- Button Close End -->

            <!-- Mobile Menu Inner Wrapper Start -->
            <div class="mobile-menu-inner-wrapper">
                <!-- Mobile Menu Search Box Start -->
                <div class="search-box-offcanvas">
                    <form>
                        <input class="search-input-offcanvas" type="text" placeholder="Search product...">
                        <button class="search-btn"><i class="pe-7s-search"></i></button>
                    </form>
                </div>
                <!-- Mobile Menu Search Box End -->

                <!-- Mobile Menu Start -->
                <div class="mobile-navigation">
                    <nav>
                        <ul class="mobile-menu">
                            <li class="has-children">
                                <a href="#">Home <i class="fa fa-angle-down"></i></a>
                                <ul class="dropdown">
                                    <li><a href="index.html">Home One</a></li>
                                    <li><a href="index-2.html">Home Two</a></li>
                                    <li><a href="index-3.html">Home Three</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Shop <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="shop.html">Shop Grid</a></li>
                                    <li><a href="shop-left-sidebar.html">Shop Left Sidebar</a></li>
                                    <li><a href="shop-right-sidebar.html">Shop Right Sidebar</a></li>
                                    <li><a href="shop-list-fullwidth.html">Shop List Fullwidth</a></li>
                                    <li><a href="shop-list-left-sidebar.html">Shop List Left Sidebar</a></li>
                                    <li><a href="shop-list-right-sidebar.html">Shop List Right Sidebar</a></li>
                                    <li><a href="wishlist.html">Wishlist</a></li>
                                    <li><a href="cart.html">Shopping Cart</a></li>
                                    <li><a href="">Checkout</a></li>
                                    <li><a href="compare.html">Compare</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Product <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="single-product.html">Single Product</a></li>
                                    <li><a href="single-product-sale.html">Single Product Sale</a></li>
                                    <li><a href="single-product-group.html">Single Product Group</a></li>
                                    <li><a href="single-product-normal.html">Single Product Normal</a></li>
                                    <li><a href="single-product-affiliate.html">Single Product Affiliate</a></li>
                                    <li><a href="single-product-slider.html">Single Product Slider</a></li>
                                    <li><a href="single-product-gallery-left.html">Gallery Left</a></li>
                                    <li><a href="single-product-gallery-right.html">Gallery Right</a></li>
                                    <li><a href="single-product-tab-style-left.html">Tab Style Left</a></li>
                                    <li><a href="single-product-tab-style-right.html">Tab Style Right</a></li>
                                    <li><a href="single-product-sticky-left.html">Sticky Left</a></li>
                                    <li><a href="single-product-sticky-right.html">Sticky Right</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Pages <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="about.html">About Us</a></li>
                                    <li><a href="contact.html">Contact</a></li>
                                    <li><a href="faq.html">Faq</a></li>
                                    <li><a href="error-404.html">Error 404</a></li>
                                    <li><a href="my-account.html">My Account</a></li>
                                    <li><a href="login.html">Loging | Register</a></li>
                                </ul>
                            </li>
                            <li class="has-children">
                                <a href="#">Blog <i class="fa fa-angle-down" aria-hidden="true"></i></a>
                                <ul class="dropdown">
                                    <li><a href="blog.html">Blog</a></li>
                                    <li><a href="blog-left-sidebar.html">Blog Left Sidebar</a></li>
                                    <li><a href="blog-right-sidebar.html">Blog Right Sidebar</a></li>
                                    <li><a href="blog-details.html">Blog Details</a></li>
                                    <li><a href="blog-details-sidebar.html">Blog Details Sidebar</a></li>
                                </ul>
                            </li>
                            <li><a href="about.html">About</a></li>
                            <li><a href="contact.html">Contact</a></li>
                        </ul>
                    </nav>
                </div>
                <!-- Mobile Menu End -->

                <!-- Language, Currency & Link Start -->
                <div class="offcanvas-lag-curr mb-6">
                    <div class="header-top-lan-curr-link">
                        <div class="header-top-lan dropdown">
                            <h4 class="title">Language:</h4>
                            <button class="dropdown-toggle" data-bs-toggle="dropdown">English <i class="fa fa-angle-down"></i></button>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="dropdown-item" href="#">English</a></li>
                                <li><a class="dropdown-item" href="#">Japanese</a></li>
                                <li><a class="dropdown-item" href="#">Arabic</a></li>
                                <li><a class="dropdown-item" href="#">Romanian</a></li>
                            </ul>
                        </div>
                        <div class="header-top-curr dropdown">
                            <h4 class="title">Currency:</h4>
                            <button class="dropdown-toggle" data-bs-toggle="dropdown">USD <i class="fa fa-angle-down"></i></button>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="dropdown-item" href="#">USD</a></li>
                                <li><a class="dropdown-item" href="#">Pound</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!-- Language, Currency & Link End -->

                <!-- Contact Links/Social Links Start -->
                <div class="mt-auto bottom-0">

                    <!-- Contact Links Start -->
                    <ul class="contact-links">
                        <li><i class="fa fa-phone"></i><a href="#"> +012 3456 789</a></li>
                        <li><i class="fa fa-envelope-o"></i><a href="#"> info@example.com</a></li>
                        <li><i class="fa fa-clock-o"></i> <span>Monday - Sunday 9.00 - 18.00</span> </li>
                    </ul>
                    <!-- Contact Links End -->

                    <!-- Social Widget Start -->
                    <div class="widget-social">
                        <a title="Facebook" href="#"><i class="fa fa-facebook-f"></i></a>
                        <a title="Twitter" href="#"><i class="fa fa-twitter"></i></a>
                        <a title="Linkedin" href="#"><i class="fa fa-linkedin"></i></a>
                        <a title="Youtube" href="#"><i class="fa fa-youtube"></i></a>
                        <a title="Vimeo" href="#"><i class="fa fa-vimeo"></i></a>
                    </div>
                    <!-- Social Widget Ende -->
                </div>
                <!-- Contact Links/Social Links End -->
            </div>
            <!-- Mobile Menu Inner Wrapper End -->

        </div>
        <!-- Mobile Menu Inner End -->
    </div>
    <!-- Mobile Menu End -->
    <!--新增数据表单-->
    <div id="addAddressForm" style="display: none;">
        <form id="addressForm" class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">收货人</label>
                <div class="layui-input-inline">
                    <input type="text" name="receivername" required lay-verify="required" placeholder="请输入收货人姓名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话号码</label>
                <div class="layui-input-inline">
                    <input type="text" name="receiverphone" required lay-verify="required" placeholder="请输入电话号码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">省</label>
                <div class="layui-input-inline">
                    <select name="receiverprovince" class="provinceSelect" lay-filter="test1" lay-verify="required">
                        <option value="">请选择省份</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">市</label>
                <div class="layui-input-inline">
                    <select name="receivercity" class="citySelect" lay-filter="test2" lay-verify="required" disabled>
                        <option value="">请选择城市</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">区</label>
                <div class="layui-input-inline">
                    <select name="receiverdistrict" class="districtSelect" lay-verify="required" disabled>
                        <option value="">请选择区域</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细地址</label>
                <div class="layui-input-inline">
                    <input type="text" name="receiveraddress" required lay-verify="required" placeholder="请输入详细地址" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <button type="button" lay-submit lay-filter="saveAddress" class="layui-btn" style="background-color: #00c4cc">保存</button>
            </div>
        </form>
    </div>

    <!-- Scripts -->
    <script src="layui/layui.all.js"></script>
    <script type="text/html" id="orderitem">
        <tr class="cart_item">
            <td class="cart-product-name text-start ps-0"> Some Winter Collections<strong
                class="product-quantity"> × 2</strong></td>
            <td class="cart-product-total text-end pe-0"><span class="amount">£145.00</span></td>
        </tr>
    </script>



    <script>
        const $ = layui.$;
        const form=layui.form;
        const urlParams = new URLSearchParams(window.location.search);
        const orderId = Number(urlParams.get('orderid'));

        //生成订单商品
        $.ajax({
            url: 'orderdetails/get',
            data: {orderid: orderId},
            success: function (result) {
                result.forEach(item => {
                    let $newRow = $('#orderitem').html()
                        .replace(' Some Winter Collections', item.thatproname)
                        .replace(' × 2', ' × ' + item.quantity)
                        .replace('£145.00', '$' + item.thatprice*item.quantity);
                    $('#orderlist').append($newRow);
                });
                updatetotalprice();
            }
        });
        //生成订单总价函数
        function updatetotalprice(){
            $.ajax({
                url:'orderdetails/sum',
                data:{orderid:orderId},
                success:function(result){
                    $('.totalprice').text('$'+result);
                }
            });
        }

        //向账单明细中回显默认地址
        displayaddress(null,1);
        function displayaddress(id,isdefault){
            $.ajax({
                url: 'receiveraddress/get',
                data: {id:id,isdefault:isdefault},
                success: function(result) {
                    result.forEach(item=>{
                        $('[name="receivernameA"]').val(item.receivername);
                        $('[name="receiverphoneA"]').val(item.receiverphone);
                        $('[name="receiverprovinceA"]').val(item.receiverprovince);
                        $('[name="receivercityA"]').val(item.receivercity);
                        $('[name="receiverdistrictA"]').val(item.receiverdistrict);
                        $('[name="receiveraddressA"]').val(item.receiveraddress);
                    });
                }
            });
        }


        $(document).ready(function () {
            // 加载地址数据
            loadAddresses();

            // 绑定点击使用按钮
            $(document).on('click', '.use-btn', function () {
                const addressId = $(this).data('id');
                console.log(addressId);
                useAddress(addressId);
            });
            // 绑定点击删除按钮
            $(document).on('click', '.delete-btn', function () {
                const addressId = $(this).data('id');
                deleteAddress(addressId);
            });
            // 绑定点击 设为默认
            $(document).on('change', '.default-radio', function () {
                const addressId = $(this).data('id');
                setDefaultAddress(addressId);
            });

            // 绑定新增按钮的点击事件
            $(document).on('click', '#addaddress', function () {
                console.log('新增按钮被点击');
                layer.open({
                    type:1,
                    title:'新增',
                    area:['400px','400px'],
                    content:$("#addAddressForm")
                });
            });
            // 绑定点击下订单按钮  更新订单表状态为未支付
            $(document).on('click', '#placeorder', function () {
                if($('[name="receiverprovinceA"]').val()==""||$('[name="receivercityA"]').val()==""||$('[name="receiverdistrictA"]').val()==""||$('[name="receiveraddressA"]').val()==""||$('[name="receivernameA"]').val()==""||$('[name="receiverphoneA"]').val()==""){
                    layer.msg("账单明细不能有空");
                    return;
                }
                console.log("下订单");
                $.ajax({
                    url:'orderaddress/add',
                    async:false,
                    data: {
                        orderid: orderId,
                        receiveraddress: $('[name="receiverprovinceA"]').val() + '/' + $('[name="receivercityA"]').val() + '/' + $('[name="receiverdistrictA"]').val() + '/' + $('[name="receiveraddressA"]').val(),
                        receivername: $('[name="receivernameA"]').val(),
                        receiverphone: $('[name="receiverphoneA"]').val()
                    },
                    success:function(){
                        $.ajax({
                            url:'orders/edit',
                            data:{status:"未支付",id:orderId},
                            success:function(){}
                        });
                    }
                });

                //跳转支付1
                // $.ajax({
                //     url: '/orders/getOrder',
                //     type: 'GET',
                //     data: { orderid: orderId },
                //     success: function(order) {
                //         // 构造支付宝支付URL
                //         var subject = encodeURIComponent("牛奶");
                //         var traceNo = encodeURIComponent(order.id);
                //         var totalAmount = encodeURIComponent(order.payment);
                //
                //         var payUrl = `/alipay/pay?subject=${subject}&traceNo=${traceNo}&totalAmount=${totalAmount}`;
                //         //跳转到支付宝支付页面
                //         window.location.href = payUrl;
                //
                //     },
                //     error: function(xhr, status, error) {
                //         alert('请求异常: ' + error);
                //     }
                // });
                //跳转支付2
                location.href='page/payment?id='+orderId;
            });

        });

        // 加载地址数据
        function loadAddresses() {
            $.ajax({
                url: 'receiveraddress/get',
                success: function (result) {
                    $('#tab-title').empty();
                    $('#tab-content').empty();
                    console.log(result);
                    result.forEach((item, index) => {
                        const tabTitle = `<li class="${index === 0 ? 'layui-this' : ''}">${index + 1}</li>`;
                        $('#tab-title').append(tabTitle);

                        const tabContent = `
                    <div class="layui-tab-item ${index === 0 ? 'layui-show' : ''}">
                        <p>收货人: ${item.receivername}</p>
                        <p>电话: ${item.receiverphone}</p>
                        <p>地址: ${item.receiverprovince} ${item.receivercity} ${item.receiverdistrict} ${item.receiveraddress}</p>
                        <button type="button" class="use-btn layui-btn layui-btn-sm" data-id="${item.id}" style="background-color: #00c4cc">使用</button>
                        <button type="button" class="delete-btn layui-btn layui-btn-sm" data-id="${item.id}" style="background-color: #00c4cc">删除</button>
                        <label style="display: flex; align-items: center; margin-top: 10px;">
                            <input type="radio" name="defaultAddress" class="default-radio" data-id="${item.id}" style="display: inline-block; margin-right: 5px;" ${item.isdefault === 1 ? 'checked' : ''}>
                            设为默认
                        </label>

                    </div>
                `;
                        $('#tab-content').append(tabContent);
                    });

                    layui.use('element', function () {
                        var element = layui.element;
                        element.init();
                    });
                }
            });
        }

        // 使用地址
        function useAddress(addressId) {
            displayaddress(addressId,null,null);
        }

        // 删除地址
        function deleteAddress(addressId) {
            if (confirm('确定要删除该地址吗？')) {
                $.ajax({
                    url: 'receiveraddress/delete',
                    data: {id:addressId},
                    success: function(response){
                        if (response.success) {
                            loadAddresses(); // 重新加载地址
                            alert('地址已删除');
                        } else {
                            alert('删除失败，请重试');
                        }
                    }
                });
            }
        }

        // 设置默认地址
        function setDefaultAddress(addressId) {
            console.log(addressId);
            $.ajax({
                url: 'receiveraddress/edit',
                data: {isdefault:0},
                success: function () {
                    $.ajax({
                        url: 'receiveraddress/edit',
                        data: {id:addressId,isdefault:1},
                        success: function () {
                            loadAddresses();
                        }
                    });
                }
            });
        }

        // 绑定保存按钮的点击事件
        layui.use('form', function () {
            var form = layui.form;
            form.on('submit(saveAddress)', function (data) {
                var formData = data.field;
                formData.isdefault=0;
                $.ajax({
                    url: 'receiveraddress/add',
                    data: formData,
                    success:function(){
                        layer.closeAll();
                        loadAddresses();
                    }
                });
                return false; // 阻止表单默认提交
            });
        });

        // 获取省市区数据
        function getDistricts(keywords) {
            return $.ajax({
                url: `https://restapi.amap.com/v3/config/district?key=d5e466c74f37e2b1f89163a68a161ea7&keywords=${keywords}&subdistrict=3`,
                dataType: 'json'
            });
        }



        // 初始化省份下拉框
        function initProvinceSelect() {
            getDistricts('中国').done(function (result) {
                const provinces = result.districts[0].districts;
                const provinceSelect = $('.provinceSelect');
                provinces.forEach(province => {
                    provinceSelect.append(`<option value="${province.name}">${province.name}</option>`);
                });
                layui.form.render('select');
            });
        }

        // 监听省份选择改变事件
        form.on('select(test1)', function (data) {
            const provinceAdcode = data.value;
            const citySelect = $('.citySelect');
            const districtSelect = $('.districtSelect');

            if (provinceAdcode) {
                getDistricts(provinceAdcode).done(function (result) {
                    const cities = result.districts[0].districts;
                    citySelect.empty().append('<option value="">请选择城市</option>');
                    districtSelect.empty().append('<option value="">请选择区域</option>');
                    cities.forEach(city => {
                        citySelect.append(`<option value="${city.name}">${city.name}</option>`);
                    });
                    citySelect.prop('disabled', false);
                    districtSelect.prop('disabled', true);
                    form.render('select');
                });
            } else {
                citySelect.empty().append('<option value="">请选择城市</option>');
                districtSelect.empty().append('<option value="">请选择区域</option>');
                citySelect.prop('disabled', true);
                districtSelect.prop('disabled', true);
                form.render('select');
            }
        });

        // 监听城市选择改变事件
        form.on('select(test2)', function (data) {
            const cityAdcode = data.value;
            const districtSelect = $('.districtSelect');

            if (cityAdcode) {
                getDistricts(cityAdcode).done(function (result) {
                    const districts = result.districts[0].districts;
                    districtSelect.empty().append('<option value="">请选择区域</option>');
                    districts.forEach(district => {
                        districtSelect.append(`<option value="${district.name}">${district.name}</option>`);
                    });
                    districtSelect.prop('disabled', false);
                    form.render('select');
                });
            } else {
                districtSelect.empty().append('<option value="">请选择区域</option>');
                districtSelect.prop('disabled', true);
                form.render('select');
            }
        });

        // 初始化省份下拉框
        initProvinceSelect();
    </script>
    <!-- Global Vendor, plugins JS -->

    <!-- Vendor JS -->


    <script src="front/js/popper.min.js"></script>
    <script src="front/js/bootstrap.min.js"></script>
    <script src="front/js/jquery-3.6.0.min.js"></script>
    <script src="front/js/jquery-migrate-3.3.2.min.js"></script>
    <script src="front/js/modernizr-3.11.2.min.js"></script>


    <!-- Plugins JS -->


    <script src="front/js/aos.min.js"></script>
    <script src="front/js/jquery.ajaxchimp.min.js"></script>
    <script src="front/js/jquery-ui.min.js"></script>
    <script src="front/js/nice-select.min.js"></script>
    <script src="front/js/swiper-bundle.min.js"></script>
    <script src="front/js/countdown.min.js"></script>
    <script src="front/js/lightgallery-all.min.js"></script>



    <!-- Use the minified version files listed below for better performance and remove the files listed above -->


    <!-- 
    <script src="assets/js/vendor.min.js"></script>
    <script src="assets/js/plugins.min.js"></script> 
    -->

    <!--Main JS-->
    <script src="front/js/main.js"></script>
</body>

</html>